package com.itheima_7;

import java.util.TreeSet;

public class TreeSetDemo {
    public static void main(String[] args) {
        TreeSet<Integer> treeSet = new TreeSet<Integer>();

        treeSet.add(10);
        treeSet.add(30);
        treeSet.add(50);
        treeSet.add(40);
        treeSet.add(20);

        treeSet.add(40);

        for (Integer i : treeSet) {
            System.out.println(i);
        }
    }
}
